package com.ruoyi.owner.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.owner.domain.FzBuildingOwner;
import com.ruoyi.owner.mapper.FzBuildingOwnerMapper;
import com.ruoyi.owner.service.IFzBuildingOwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 业主成员Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-03-09
 */
@Service
public class FzBuildingOwnerServiceImpl implements IFzBuildingOwnerService
{
    @Autowired
    private FzBuildingOwnerMapper fzBuildingOwnerMapper;

    /**
     * 查询业主成员
     * 
     * @param memberId 业主成员ID
     * @return 业主成员
     */
    @Override
    public FzBuildingOwner selectFzBuildingOwnerById(String memberId)
    {
        return fzBuildingOwnerMapper.selectFzBuildingOwnerById(memberId);
    }

    /**
     * 查询业主成员列表
     * 
     * @param fzBuildingOwner 业主成员
     * @return 业主成员
     */
    @Override
    public List<FzBuildingOwner> selectFzBuildingOwnerList(FzBuildingOwner fzBuildingOwner)
    {
        return fzBuildingOwnerMapper.selectFzBuildingOwnerList(fzBuildingOwner);
    }

    /**
     * 新增业主成员
     * 
     * @param fzBuildingOwner 业主成员
     * @return 结果
     */
    @Override
    public int insertFzBuildingOwner(FzBuildingOwner fzBuildingOwner)
    {
        fzBuildingOwner.setCreateTime(DateUtils.getNowDate());
        return fzBuildingOwnerMapper.insertFzBuildingOwner(fzBuildingOwner);
    }

    /**
     * 修改业主成员
     * 
     * @param fzBuildingOwner 业主成员
     * @return 结果
     */
    @Override
    public int updateFzBuildingOwner(FzBuildingOwner fzBuildingOwner)
    {
        fzBuildingOwner.setUpdateTime(DateUtils.getNowDate());
        return fzBuildingOwnerMapper.updateFzBuildingOwner(fzBuildingOwner);
    }

    /**
     * 删除业主成员对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFzBuildingOwnerByIds(String ids)
    {
        return fzBuildingOwnerMapper.deleteFzBuildingOwnerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除业主成员信息
     * 
     * @param memberId 业主成员ID
     * @return 结果
     */
    @Override
    public int deleteFzBuildingOwnerById(String memberId)
    {
        return fzBuildingOwnerMapper.deleteFzBuildingOwnerById(memberId);
    }
}
